﻿using Learun.Util;
using SqlSugar;
using System;

namespace Learun.Application.TwoDevelopment.ZZDT_EC
{
    /// <summary>
    /// 描 述：工况
    /// </summary>
    [SugarTable(TableName = "ec_case")]
    public class ec_CaseEntity
    {
        #region 实体成员
        /// <summary>
        /// ID。caseId为0时默认工况
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string CaseID { get; set; }
        /// <summary>
        /// 工况名称
        /// </summary>
        /// <returns></returns>
        public string CaseName { get; set; } = "";
        /// <summary>
        /// 是否为激活状态的工况。1激活，0不激活
        /// </summary>
        /// <returns></returns>
        public string IsActive { get; set; } = "";
        /// <summary>
        /// 排序
        /// </summary>
        public int? OrderID { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion
        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.CaseID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;


        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.CaseID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段
        #endregion
    }
}
